package org.karesz.code.generic;

import java.util.List;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 * Generic DAO implementation for most common DB methods
 * 
 * @author gubak
 *
 * @param <T>
 */
@Stateless
public class GenericDAOImpl<T> implements GenericDAO<T>{

	@PersistenceContext
	private EntityManager em;	
	
	@Override
	public void save(T entity) {
		em.persist(entity);
		
	}

	@Override
	public void delete(T entity) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void update(T entity) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public T findById(long id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<T> findAll() {
		// TODO Auto-generated method stub
		return null;
	}

}
